<!DOCTYPE html>


<html lang="zh-CN,en,default">
  

    <head>
      <meta charset="utf-8" />
       
      <meta name="keywords" content="阳小良,个人博客,程序猿,插画师,技术博客,人生感悟" />
       
      <meta name="description" content="不想做插画师的程序猿，不是好厨师" />
      
      <meta
        name="viewport"
        content="width=device-width, initial-scale=1, maximum-scale=1"
      />
      <title>零基础-搭建个人博客3-博客环境 |  阳小良</title>
  <meta name="generator" content="hexo-theme-ayer">
      
      <link rel="shortcut icon" href="/favicon.ico" />
       
<link rel="stylesheet" href="/dist/main.css">

      
<link rel="stylesheet" href="/css/fonts/remixicon.css">

      
<link rel="stylesheet" href="/css/custom.css">
 
      <script src="https://cdn.staticfile.org/pace/1.2.4/pace.min.js"></script>
       
 

      <link
        rel="stylesheet"
        href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-bulma@5.0.1/bulma.min.css"
      />
      <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.19/dist/sweetalert2.min.js"></script>

      <!-- mermaid -->
      
      <style>
        .swal2-styled.swal2-confirm {
          font-size: 1.6rem;
        }
      </style>
    </head>
  </html>
</html>


<body>
  <div id="app">
    
      
    <main class="content on">
      <section class="outer">
  <article
  id="post-tech/createBlogs/零基础-搭建个人博客3-博客环境"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h1 class="article-title sea-center" style="border-left:0" itemprop="name">
  零基础-搭建个人博客3-博客环境
</h1>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/2025/01/15/tech/createBlogs/%E9%9B%B6%E5%9F%BA%E7%A1%80-%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A23-%E5%8D%9A%E5%AE%A2%E7%8E%AF%E5%A2%83/" class="article-date">
  <time datetime="2025-01-15T15:13:14.000Z" itemprop="datePublished">2025-01-15</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E8%B0%8B%E7%94%9F%E6%89%8B%E6%AE%B5/">谋生手段</a> / <a class="article-category-link" href="/categories/%E8%B0%8B%E7%94%9F%E6%89%8B%E6%AE%B5/%E9%9B%B6%E5%9F%BA%E7%A1%80/">零基础</a> / <a class="article-category-link" href="/categories/%E8%B0%8B%E7%94%9F%E6%89%8B%E6%AE%B5/%E9%9B%B6%E5%9F%BA%E7%A1%80/%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/">搭建个人博客</a>
  </div>
  
<div class="word_count">
    <span class="post-time">
        <span class="post-meta-item-icon">
            <i class="ri-quill-pen-line"></i>
            <span class="post-meta-item-text"> 字数统计:</span>
            <span class="post-count">1.4k</span>
        </span>
    </span>

    <span class="post-time">
        &nbsp; | &nbsp;
        <span class="post-meta-item-icon">
            <i class="ri-book-open-line"></i>
            <span class="post-meta-item-text"> 阅读时长≈</span>
            <span class="post-count">5 分钟</span>
        </span>
    </span>
</div>
 
    </div>
      
    <div class="tocbot"></div>




  
    <div class="article-entry" itemprop="articleBody">
       
  <h2 id="本篇目的"><a href="#本篇目的" class="headerlink" title="本篇目的"></a>本篇目的</h2><blockquote>
<p>通过挑选好的自定义的模板来完成自己博客的本地化运行，并理解hexo的相关配置信息和文件结构；为后续的博客精进化之路打下一定的基础。</p>
</blockquote>
<h2 id="博客环境："><a href="#博客环境：" class="headerlink" title="博客环境："></a>博客环境：</h2><h3 id="1-初始hexo文件目录："><a href="#1-初始hexo文件目录：" class="headerlink" title="1.初始hexo文件目录："></a>1.初始hexo文件目录：</h3><blockquote>
<p><img src="http://files.sid2656.space/tech/createBlogs/hexoDir.jpg" alt="个人博客" title="初始化 hexo"></p>
<p>node_modules：是你初始化博客需要的一些基础依赖的三方模块。这里不需要你关注和改动；</p>
<p>scaffolds：应该是hexo的模板类文件；这里也不需要你关注和改动；</p>
<p>source：这个是你写文章的源码目录，后续的所有文章都在这里添加；</p>
<p>public：这个是服务启动后生成的静态页面&amp;资源文件的目录；这个也就是后续需要部署到github的pages服务中的全部文件；</p>
<p>themes：这个是hexo你依赖的主题模板，这个可以在hexo社区中找你自己喜欢的模板；</p>
<blockquote>
<p><a target="_blank" rel="noopener" href="https://hexo.io/themes/">https://hexo.io/themes/</a></p>
</blockquote>
<p>我选择的是Ayer模板：</p>
<blockquote>
<p><a target="_blank" rel="noopener" href="https://github.com/shen-yu/hexo-theme-ayer">https://github.com/shen-yu/hexo-theme-ayer</a></p>
</blockquote>
<p>此模板目前已经不再维护了；但是基础功能还是可以使用的，样式简洁清晰，分类标签满足诉求，打赏功能集成在里面。<br>接下来我就根据这个模板来进行的的博客系统的初始化工作；</p>
<p>剩余的文件只需要关注_config.yml即可，这个是你博客系统的核心配置文件。稍后步骤3中我们会提到。</p>
</blockquote>
<h3 id="2-将选定的模板部署到本地："><a href="#2-将选定的模板部署到本地：" class="headerlink" title="2.将选定的模板部署到本地："></a>2.将选定的模板部署到本地：</h3><blockquote>
<blockquote>
<p>git clone <a target="_blank" rel="noopener" href="https://github.com/Shen-Yu/hexo-theme-ayer.git">https://github.com/Shen-Yu/hexo-theme-ayer.git</a> themes&#x2F;ayer</p>
</blockquote>
<p>在终端或者bash窗口中，进入到你的博客系统文件夹；就是1中图片展示的文件目录；</p>
<p>在终端或者bash窗口中执行上述的git命令，目的是将github上的模板拷贝到本机</p>
</blockquote>
<h3 id="3-设置博客的基础配置："><a href="#3-设置博客的基础配置：" class="headerlink" title="3.设置博客的基础配置："></a>3.设置博客的基础配置：</h3><blockquote>
<p>在终端或者bash窗口中，进入到你的博客系统文件夹；就是1中图片展示的文件目录；</p>
<p>打开基础配置文件：_config.yml（这里是系统配置）</p>
<p><img src="http://files.sid2656.space/tech/createBlogs/base_config.jpg" alt="个人博客" title="启动 ayer"></p>
</blockquote>
<details>
<summary>展开详情——修改如下配置：</summary>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">title: 阳小良</span><br><span class="line">subtitle: &#x27;体验式人生&#x27;</span><br><span class="line">description: &#x27;不想做插画师的程序猿，不是好厨师&#x27;</span><br><span class="line">keywords: 阳小良,个人博客,程序猿,插画师,技术博客,人生感悟</span><br><span class="line">author: 阿良</span><br><span class="line">language:</span><br><span class="line">  - zh-CN</span><br><span class="line">  - en</span><br><span class="line">theme: ayer</span><br></pre></td></tr></table></figure>
</details>

<blockquote>
<p>如果不想修改博客名称等配置，可以只修改主题：</p>
<blockquote>
<p>theme: ayer</p>
</blockquote>
<p>然后在终端执行如下命令：</p>
<blockquote>
<p>hexo s</p>
</blockquote>
<p><img src="http://files.sid2656.space/tech/createBlogs/hexo-s.jpg" alt="个人博客" title="启动 ayer"></p>
<p>能提示ayer主题，并打印出：<a target="_blank" rel="noopener" href="http://localhost:4000/">http://localhost:4000</a> ，即表明hexo模板安装成功；</p>
</blockquote>
<h3 id="4-访问基础模板网页："><a href="#4-访问基础模板网页：" class="headerlink" title="4.访问基础模板网页："></a>4.访问基础模板网页：</h3><blockquote>
<p>在浏览器中执行：<a target="_blank" rel="noopener" href="http://localhost:4000/">http://localhost:4000</a> ，我们可以得到如下网页：</p>
<p><img src="http://files.sid2656.space/tech/createBlogs/home_v.gif" alt="个人博客" title="启动 ayer"></p>
<p>可以看到基本上的博客框架已经出来了，里面的页面title，网页描述，关键字这些我都没有调整；仅仅是修改了theme对应的主题；</p>
</blockquote>
<h3 id="5-配置分类和标签："><a href="#5-配置分类和标签：" class="headerlink" title="5.配置分类和标签："></a>5.配置分类和标签：</h3><blockquote>
<p>我们通过步骤4已经将基础的模块和效果呈现出来了，但是我们点击分类和标签发现是找不到对应的路径。</p>
<p>这是因为我们默认的系统中并未设置对应的分类和配置；我们可以按照模板上说明的步骤去创建分类和标签。</p>
<p>创建基础分类模块：（以下命令均需要在您的博客从基础文件夹根路径中执行）</p>
<blockquote>
<p>hexo new page categories</p>
</blockquote>
<p><img src="http://files.sid2656.space/tech/createBlogs/cate.jpg" alt="个人博客" title="启动 ayer"></p>
<p>接下来我们打开categories文件夹下面的index.md，并修改其文件内容如下：</p>
</blockquote>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: 分类列表</span><br><span class="line">type: categories</span><br><span class="line">layout: &quot;categories&quot;</span><br><span class="line">---</span><br></pre></td></tr></table></figure>
<blockquote>
<p>tags的创建方式类似于categories；只不过需要修改tags&#x2F;index.md的文件内容如下：</p>
</blockquote>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: 标签列表</span><br><span class="line">type: &quot;tags&quot;</span><br><span class="line">layout: &quot;tags&quot;</span><br><span class="line">---</span><br></pre></td></tr></table></figure>
<blockquote>
<p>friends的创建方式类似于categories；只不过需要修改friends&#x2F;index.md的文件内容如下：</p>
</blockquote>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: 友情链接</span><br><span class="line">type: friends</span><br><span class="line">layout: &quot;friends&quot;</span><br><span class="line">---</span><br></pre></td></tr></table></figure>
<blockquote>
<p>为了让上面的内容生效后，大家更容易理解，我们可以打开默认的hello-world.md（其位置在{你博客的根目录}&#x2F;source&#x2F;_post&#x2F;hello-world.md）</p>
<p>在头几行修改配置，增加分类和标签，如下配置：</p>
</blockquote>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: Hello World</span><br><span class="line">tags:</span><br><span class="line">  - 五味杂陈</span><br><span class="line">categories:</span><br><span class="line">  - 零基础</span><br><span class="line">---</span><br></pre></td></tr></table></figure>
<blockquote>
<p>这样，我们再次打开主页，点击分类和标签，便可以看到数据都正常了；</p>
<p><img src="http://files.sid2656.space/tech/createBlogs/home_v2.gif" alt="个人博客" title="启动 ayer"></p>
</blockquote>
<h3 id="6-模板细节调整："><a href="#6-模板细节调整：" class="headerlink" title="6.模板细节调整："></a>6.模板细节调整：</h3><h4 id="6-1模板配置文件调整："><a href="#6-1模板配置文件调整：" class="headerlink" title="6.1模板配置文件调整："></a>6.1模板配置文件调整：</h4><blockquote>
<p>模板的基础配置我们可以根据自己的诉求进行调整，具体调整的位置路径：</p>
<blockquote>
<p>{你博客的根目录}&#x2F;themes&#x2F;ayer&#x2F;_config.yml</p>
</blockquote>
<p>这里的config文件对应的是你的页面模板的配置，不是根目录下面的那个基础环境的配置；</p>
<p>这个每个人按照你自己的博客诉求进行调整即可。</p>
</blockquote>
<h4 id="6-2日志内容填写："><a href="#6-2日志内容填写：" class="headerlink" title="6.2日志内容填写："></a>6.2日志内容填写：</h4><blockquote>
<p>接下来我们就可以按照自己的意愿去分类填写自己的个人博客内容了；<br><img src="https://files.sid2656.space/tech/createBlogs/post.jpg" alt="个人博客" title="install hexo"></p>
<p>如上图所示，你创建的md文档只有都放在_post文件夹中，这里可以安装自己的喜好设置不同的文件件，方便文章的管理和区分</p>
<p>我们在_post下新建md文件，并设置好上面我们提到抬头分类，比如本章的抬头分类我设置如下：</p>
</blockquote>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: 零基础-搭建个人博客3-博客环境</span><br><span class="line">date: 2015-01-14 23:13:14</span><br><span class="line">tags:</span><br><span class="line">  - 谋生手段</span><br><span class="line">  - hexo</span><br><span class="line">  - 零基础</span><br><span class="line">categories:</span><br><span class="line">  - 谋生手段</span><br><span class="line">  - [零基础,搭建个人博客]</span><br><span class="line">---</span><br></pre></td></tr></table></figure>
<blockquote>
<p>其中[零基础,搭建个人博客]；这个表示的是二级分类；<br>展示效果如下：<br><img src="https://files.sid2656.space/tech/createBlogs/cate-2.jpg" alt="个人博客" title="启动 hexo"></p>
</blockquote>
 
      <!-- reward -->
      
      <div id="reword-out">
        <div id="reward-btn">
          打赏
        </div>
      </div>
      
    </div>
    

    <!-- copyright -->
    
    <div class="declare">
      <ul class="post-copyright">
        <li>
          <i class="ri-copyright-line"></i>
          <strong>版权声明： </strong>
          
          本博客所有文章除特别声明外，著作权归作者所有。转载请注明出处！
          
        </li>
      </ul>
    </div>
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/hexo/" rel="tag">hexo</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E8%B0%8B%E7%94%9F%E6%89%8B%E6%AE%B5/" rel="tag">谋生手段</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E9%9B%B6%E5%9F%BA%E7%A1%80/" rel="tag">零基础</a></li></ul>

    </footer>
  </div>

   
  <nav class="article-nav">
    
      <a href="/2025/01/16/tech/createBlogs/%E9%9B%B6%E5%9F%BA%E7%A1%80-%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A24-%E9%83%A8%E7%BD%B2%E5%88%B0github%E4%B8%8A/" class="article-nav-link">
        <strong class="article-nav-caption">上一篇</strong>
        <div class="article-nav-title">
          
            零基础-搭建个人博客4-部署到github上
          
        </div>
      </a>
    
    
      <a href="/2025/01/14/tech/createBlogs/%E9%9B%B6%E5%9F%BA%E7%A1%80-%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A22-%E5%9F%BA%E7%A1%80%E7%8E%AF%E5%A2%83/" class="article-nav-link">
        <strong class="article-nav-caption">下一篇</strong>
        <div class="article-nav-title">零基础-搭建个人博客2-基础环境</div>
      </a>
    
  </nav>

  
   
     
</article>

</section>
      <footer class="footer">
  <div class="outer">
    <ul>
      <li>
        Copyrights &copy;
        2011-2025
        <i class="ri-heart-fill heart_icon"></i> 阿良
      </li>
    </ul>
    <ul>
      <li>
        
      </li>
    </ul>
    <ul>
      <li>
        
        
        <span>
  <span><i class="ri-user-3-fill"></i>访问人数:<span id="busuanzi_value_site_uv"></span></span>
  <span class="division">|</span>
  <span><i class="ri-eye-fill"></i>浏览次数:<span id="busuanzi_value_page_pv"></span></span>
</span>
        
      </li>
    </ul>
    <ul>
      
        <li>
          <a href="https://beian.miit.gov.cn/" target="_black" rel="nofollow">京ICP备14051636号-6</a>
        </li>
        
    </ul>
    <ul>
      
    </ul>
    <ul>
      <li>
        <!-- cnzz统计 -->
        
      </li>
    </ul>
  </div>
</footer>    
    </main>
    <div class="float_btns">
      <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>

<div class="todark" id="todark">
  <i class="ri-moon-line"></i>
</div>

    </div>
    <aside class="sidebar on">
      <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ayer-side.svg" alt="阳小良"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">归档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories/">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories/%E5%8E%9F%E8%91%97/">原著</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories/%E4%BA%94%E5%91%B3%E6%9D%82%E9%99%88/%E5%A4%A9%E6%B6%AF%E6%B5%B7%E8%A7%92/">旅行</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories/%E8%B0%8B%E7%94%9F%E6%89%8B%E6%AE%B5/">技术</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories/%E6%8A%95%E8%B5%84%E8%87%AA%E5%B7%B1/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/">读书</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" target="_blank" rel="noopener" href="https://hi.huitu.com/1145549/">摄影</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" target="_blank" rel="noopener" href="https://space.bilibili.com/3546831053129882/channel/seriesdetail?sid=4562367&ctype=0">画廊</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/friends">友链</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/2011/02/14/about">关于我</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="搜索">
        <i class="ri-search-line"></i>
      </a>
      
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
    </aside>
    <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="/images/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="/images/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
    
<script src="/js/jquery-3.6.0.min.js"></script>
 
<script src="/js/lazyload.min.js"></script>

<!-- Tocbot -->
 
<script src="/js/tocbot.min.js"></script>

<script>
  tocbot.init({
    tocSelector: ".tocbot",
    contentSelector: ".article-entry",
    headingSelector: "h1, h2, h3, h4, h5, h6",
    hasInnerContainers: true,
    scrollSmooth: true,
    scrollContainer: "main",
    positionFixedSelector: ".tocbot",
    positionFixedClass: "is-position-fixed",
    fixedSidebarOffset: "auto",
  });
</script>

<script src="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.js"></script>
<link
  rel="stylesheet"
  href="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.css"
/>
<script src="https://cdn.staticfile.org/justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js"></script>

<script src="/dist/main.js"></script>

<!-- ImageViewer -->
 <!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.staticfile.org/photoswipe/4.1.3/default-skin/default-skin.min.css">
<script src="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe.min.js"></script>
<script src="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script> 
<!-- MathJax -->

<!-- Katex -->

<!-- busuanzi  -->
 
<script src="/js/busuanzi-2.3.pure.min.js"></script>
 
<!-- ClickLove -->

<!-- ClickBoom1 -->

<!-- ClickBoom2 -->

<!-- CodeCopy -->

<!-- CanvasBackground -->

<script>
  if (window.mermaid) {
    mermaid.initialize({ theme: "forest" });
  }
</script>


    
    

  </div>
</body>

</html>